﻿//-----------------------------------------------------------------------
// <copyright file="TokenController.cs" company="SLWY Enterprises">
// * Copyright (C) 2017 四川商旅无忧科技有限公司 版权所有。
// * version : 1.0
// * author  : qinchaoyue
// * FileName: TokenController.cs
// * history : created by qinchaoyue 2017-11-21 01:36:51
// </copyright>
//-----------------------------------------------------------------------

namespace WebApplication.Controllers
{
    using Microsoft.AspNetCore.Cors;
    using Microsoft.AspNetCore.Mvc;
    using Slwy.Mvc.Controller;

    /// <summary>
    /// token 测试类
    /// </summary>
    [EnableCors("any")]
    public class TokenController : SlwyController
    {
        /// <summary>
        /// 测试 从头部获取token
        /// </summary>
        /// <returns>token</returns>
        [HttpGet("Token")]
        public IActionResult GetToken()
        {
            return this.Ok(this.Token);
        }

        /// <summary>
        /// 测试 从token 中 获取当前操作者
        /// </summary>
        /// <returns>当前操作者</returns>
        [HttpGet("Operator")]
        public IActionResult GetOperator()
        {
            return this.Ok(this.Operator);
        }
    }
}
